<?php defined('SYSTEM_IN') or exit('Access Denied');?>
<?php include page('header_base');?>
<title>预约表</title>
<link href="<?php echo RESOURCE_ROOT;?>public/weui.min.css" rel="stylesheet">
<link href="<?php echo RESOURCE_ROOT;?>public/weui.plus.css?v=2" rel="stylesheet">
<style type="text/css">
    body {<?php if(is_mobile()){?>margin:0px;<?php }?>background:#efefef; font-family:'微软雅黑'; -moz-appearance:none;}
    a {text-decoration:none;}

    .address_addnav {height:44px; width:94%; padding:0 3%; border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; line-height:42px; color:#666; background:#fff;}
    .address_list {height:50px; padding:0 10px;  border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; background:#fff;}
    .address_list .ico {height:50px; width:30px;   float:left; color:#999;margin-right:-30px; z-index:2}
    .address_list .ico i { font-size:24px;margin-top:15px;margin-left:10px;z-index:2;position: relative;}
    .address_list .info {height:50px; width:100%; float:left;position: relative;}
    .address_list .info .inner { margin-left:40px;margin-right:50px;}
    .address_list .info .inner .addr {height:20px; width:100%; color:#999; line-height:26px; font-size:14px; overflow:hidden;}
    .address_list .info .inner .user {height:30px; width:100%; color:#666; line-height:30px; font-size:16px; overflow:hidden;}
    .address_list .info .inner .user span {color:#444; font-size:16px;}
    .address_list .btn { width:45px; float:right;margin-left:-45px;z-index:2;position: relative;}
    .address_list .btn .edit,.address_list .btn .remove {height:50px; float:right; color:#999; font-size:18px;margin-top:5px;}
    .address_list .btn .edit { margin-right:10px;}
    
.address_addnav {height:40px;  border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:14px; line-height:40px; color:#666; }
.address_main {height:auto;width:94%; padding:0px; border-bottom:1px solid #f0f0f0; border-top:1px solid #f0f0f0; margin-top:0px; background:#fff;}
.address_main .line {height:44px; width:100%; border-bottom:1px solid #f0f0f0; line-height:44px;}

.address_main .line input {float:left; height:44px; width:100%; padding:0px; margin:0px; border:0px; outline:none; font-size:16px; color:#666;padding-left:5px;}
.address_main .line select  { border:none;height:25px;width:100%;color:#666;font-size:16px;}
.address_sub1 {height:44px; margin:14px 10px; background:#ff4f4f; border-radius:4px; text-align:center; font-size:16px; line-height:44px; color:#fff;}
.address_sub2 {height:44px; margin:14px 10px; background:#ddd; border-radius:4px; text-align:center; font-size:16px; line-height:44px; color:#666; border:1px solid #d4d4d4;}
</style>
<!-- <script type="text/javascript" src="<?php  echo RESOURCE_ROOT;?>eshop/static/js/dist/area/cascade.js"></script> -->
<script>

/**
 * 提交注册
 * 
 * @param obj
 * @returns {Boolean}
 */

function submitlogin(obj) {
    reg=/^\d+$/;

    if($.trim($('#realname').val()) == ''){
        alert('姓名不能为空！');
        return false;
    }
    if($.trim($('#people-num').val()) == ''){
        alert('此行人数不能为空！');
        return false;
    }
    if(!reg.test($.trim($('#people-num').val()))){
        alert('此行人数只能为数字！');
        return false;
    }
    
    if($.trim($('#wechat').val()) == ''){
        alert('微信二维码不能为空！');
        return false;
    }
    if($.trim($('#getto-flight').val()) == ''){
        alert('到达航班号不能为空！');
        return false;
    }
    if($.trim($('#tmp-getto-date').val()) == ''){
        alert('到达日期不能为空！');
        return false;
    }
    if($.trim($('#tmp-getto-time').val()) == ''){
        alert('到达时间不能为空！');
        return false;
    }
    if($.trim($('#packet-num').val()) != ''){
        if(!reg.test($.trim($('#packet-num').val()))){
            alert('行李数只能为数字！');
            return false;
        }
    }
    $('#getto-time').val($('#tmp-getto-date').val()+'T'+$('#tmp-getto-time').val().substr(0,5));
    if($.trim($('#tmp-setoff-date').val()) != ''){
        if($.trim($('#tmp-setoff-time').val()) == ''){
            alert('请填写完整出发日期和时间');
            return false;
        }
    }
    if($.trim($('#tmp-setoff-time').val()) != ''){
        if($.trim($('#tmp-setoff-date').val()) == ''){
            alert('请填写完整出发日期和时间');
            return false;
        }
    }
    if($.trim($('#tmp-setoff-date').val()) != '' && $.trim($('#tmp-setoff-time').val()) != ''){
        $('#setoff-time').val($('#tmp-setoff-date').val()+'T'+$('#tmp-setoff-time').val().substr(0,5));
    }
    else{
        $('#setoff-time').val('');
    }
    //$('#setoff_time').val($('#setoff_time').val().substr(0,16));
    $('#submitButton').attr('onclick','void(0);');
    $('#submitButton').html('提交中...');
    $('#submit').click();
}	
</script>
<form method="post" id="form_id" enctype="multipart/form-data">
	   
<div class="weui-cells_form" style="  margin-bottom:50px;   border-bottom: 0px solid #FFF;   margin-top: 0;">
	 <div class="page_topbar" >
     <a href="<?php echo create_url('mobile',array('act' => 'shopwap','do' => 'reservation_list'));?>" class="back"  style="color: #fff;text-align:center;"><i class="fa fa-angle-left"></i></a>
    <div class="title" style="color: #fff;text-align:center;">填写预约表</div>
</div>
        <div class="weui-cells__title">预约区域(<font color="red">必选</font>)</div>
        <div class="weui-cells weui-cells_radio">
            <label class="weui-cell weui-check__label" for="radio1">
                <div class="weui-cell__bd">
                    <p>首尔</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" class="weui-check" name="reserve-area" id="radio1" checked="checked" value="首尔"/>
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
            <label class="weui-cell weui-check__label" for="radio2">

                <div class="weui-cell__bd">
                    <p>济州</p>
                </div>
                <div class="weui-cell__ft">
                    <input type="radio" name="reserve-area" class="weui-check" id="radio2" value="济州"/>
                    <span class="weui-icon-checked"></span>
                </div>
            </label>
        </div>
        <div class="weui-cells__title"><font color="red">必填项</font></div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">(<font color="red">真实</font>)姓名</label>
                </div>
                <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="realname"  name="realname" placeholder="请输入您的姓名" value="" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">此行人数</label>
                </div>
                <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="people-num"  name="people-num" placeholder="请输入此行人数" value="" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">微信二维码</label>
                </div>
                <div class="weui-cell__bd">
                <img src="<?php if(!empty($memberinfo['avatar'])){ echo $memberinfo['avatar'];}else{?><?php  echo RESOURCE_ROOT;?>eshop/mobile/default/static/images/tx.png<?php }?>" id="wechat-avatar"  style="width:80px;height:80px;  float: left;" onerror="this.src='<?php  echo RESOURCE_ROOT;?>eshop/mobile/default/static/images/tx.png'"/>
                
                   <div class="weui-uploader__input-box" style="margin-left:10px">
                        <input name="wechat-image"  id="wechat" class="weui-uploader__input" type="file" accept="image/*" multiple="">
                    </div>
                
                 </div>
                <!-- <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="wechat"  name="wechat" placeholder="请输入微信号" value="" />
                </div> -->
            </div>
            
        </div>
        <div class="weui-cells__title">到达航班(<font color="red">必填，请准确填写</font>)</div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">到达航班号</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" id="getto-flight" name="getto-flight" value=""/>
                    <input type="hidden" name="getto-date" id="getto-time" value=""/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">到达日期</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="date" name="tmp-getto-date" id="tmp-getto-date" value=""/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">到达时间</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="time" name="tmp-getto-time" id="tmp-getto-time" value=""/>
                </div>
            </div>

        </div>
        
        <div class="weui-cells__title">出发航班(<font color="red">选填，请准确填写</font>)</div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">出发航班号</label>
                </div>
                
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" name="setoff-flight" value=""/>
                    <input type="hidden" name="setoff-date" id="setoff-time" value=""/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">出发日期</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="date" name="tmp-setoff-date" id="tmp-setoff-date" value=""/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">出发时间</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="time" name="tmp-setoff-time" id="tmp-setoff-time" value=""/>
                </div>
            </div>
        </div>
        <div class="weui-cells__title">备注信息</div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">行李数</label>
                </div>
                <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="packet-num"  name="packet-num" placeholder="请输入行李数" value="" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">入住酒店</label>
                </div>
                <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="hotel" name="hotel" placeholder="请输入入住酒店" value="" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">酒店地址信息截图</label>
                </div>
                <div class="weui-cell__bd">
                <img src="<?php if(!empty($memberinfo['avatar'])){ echo $memberinfo['avatar'];}else{?><?php  echo RESOURCE_ROOT;?>eshop/mobile/default/static/images/tx.png<?php }?>" id="hotel-avatar"  style="width:80px;height:80px;  float: left;" onerror="this.src='<?php  echo RESOURCE_ROOT;?>eshop/mobile/default/static/images/tx.png'"/>
                
                   <div class="weui-uploader__input-box" style="margin-left:10px">
                        <input name="hotel-image"  id="hotel-image" class="weui-uploader__input" type="file" accept="image/*" multiple="">
                    </div>
                
                 </div>
                <!-- <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="wechat"  name="wechat" placeholder="请输入微信号" value="" />
                </div> -->
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label">备注</label>
                </div>
                <div class="weui-cell__bd">
                  <input type="text"  class="weui-input" autocomplete="off" id="remark"  name="remark" placeholder="请输入备注" value="" />
                </div>
            </div>
        </div>
        <div class="weui-btn-area">
            <a class="weui-btn weui-btn_primary" onclick="submitlogin('');" id="submitButton">确定提交</a>
                    <button type="submit" id='submit'  name="submit" value="yes" style="display:none" >x</button>
        </div>
       
        </div>
</form>

 <div class="js_dialog" id="iosDialog" style="display: none;">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__bd" id="emsg"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" id="iosDialog_btn" onclick=" $('#iosDialog').fadeOut(200);" class="weui-dialog__btn weui-dialog__btn_primary">知道了</a>
                </div>
            </div>
        </div>
    
 <script type="text/javascript">
    $(function(){
        var address = null;
        //cascdeInit();
		$wechatInput = $("#wechat"),
        $wechatInput.on("change", function(e){
            var src, url = window.URL || window.webkitURL || window.mozURL, files = e.target.files;
            for (var i = 0, len = files.length; i < len; ++i) {
                var file = files[i];

                if (url) {
                    src = url.createObjectURL(file);
                } else {
                    src = e.target.result;
                }
   							 $("#wechat-avatar").attr("src", src);
            }
        });
        $hotelInput = $("#hotel-image"),
        $hotelInput.on("change", function(e){
            var src, url = window.URL || window.webkitURL || window.mozURL, files = e.target.files;
            for (var i = 0, len = files.length; i < len; ++i) {
                var file = files[i];

                if (url) {
                    src = url.createObjectURL(file);
                } else {
                    src = e.target.result;
                }
                             $("#hotel-avatar").attr("src", src);
            }
        });
    
    });

	     $('.gender').click(function() {
                    var $this = $(this);
                    var val = $this.data('val');
                    $('.gender').find('i').css('color', '#999').removeClass('fa-check-circle-o').addClass('fa-circle-o');
                    $(this).find('i').removeClass('fa-circle-o').addClass('fa-check-circle-o').css('color', '#0c9');
                    $('#gender').val(val);
                });
	</script>
<?php  $show_footer=true;?>
<?php include page('footer_menu');?>
<?php include page('footer_base');?>